// 个人信息管理，修改
// 封装显示当前数据的函数
function infos(){
    var name=localStorage.getItem("userName")
    var userRole=localStorage.getItem("userRole")
    var names=document.querySelector(".names")
    var user=document.querySelector(".user")
    names.value=name
    user.value=userRole
}
infos()

function rload(){
    var name=document.querySelector(".names")
    var sex=document.querySelector(".sex")
    var dept=document.querySelector(".dept")
    var tel=document.querySelector(".tel")
    var pwd=document.querySelector(".pwd")
    var user=document.querySelector(".user")
    var index=localStorage.getItem("userid")
    var num=Number(index)
    let roa={
        userPassword:pwd.value,
        userId:num,
        userName:name.value,
        userRole:user.value,
        userGender:sex.value,
        userDept:dept.value,
        userPhone:tel.value
    }
   if(name!=""&&sex!=""&&dept!=""&&tel!=""&&pwd!=""&&user!=""){
    ajaxHttp("post","user/updateUserInfo",roa).then((res)=>{
        console.log(res);
    })
   }else{
    alert("数据不能存在空值")
   }
}